<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/6/14 0014
  Time: 下午 6:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style type="text/css">
        a{text-decoration: none;}
        a,a:visited{text-decoration: none;color: #000000;}
        a:hover{text-decoration: none;color: red;}

    </style>
</head>
<table  border="1px" align="center" cellpadding="10" bordercolor="#000" cellspacing="0"  width="700">
    <tr>
        <th colspan="6">用户信息管理系统</th>
    </tr>
    <tr>
        <th colspan="6" align="left"><a href="/add">添加用户</a></th>
    </tr>

    <tr>
        <th>姓名</th>
        <th>密码</th>
        <th>性别</th>
        <th>年龄</th>
        <th colspan="2" >操作</th>

    </tr>
<c:forEach items="${pager.datas}" var="user">
    <tr>
         <td> ${user.username}</td>
         <td> ${user.password}</td>
         <td> ${user.gender}</td>
         <td> ${user.descc}</td>
    <td>  <a href="<c:url value="/${user.username}/deleted" />">删除</a></td>
    <td> <a href="<c:url value="/${user.username}/update"/> ">修改</a></td>
    </tr>
</c:forEach>
<tr>
    <td  colspan="6" align="right">
        <c:if test="${pager.pageIndex != 1}">
            <a href="/users/${pager.pageIndex - 1}">上一页</a>
        </c:if>
        <c:forEach begin="1" end="${pager.allPage}" varStatus="status">
            <c:if test="${pager.pageIndex != status.index}">
                <a href="/users/${status.index}">${status.index}</a>
            </c:if>
            <c:if test="${pager.pageIndex == status.index}">
                <span style="color:red;">${[status.index]}</span>
            </c:if>

        </c:forEach>
        <c:if test="${pager.pageIndex != pager.allPage}">
            <a href="/users/${pager.pageIndex + 1}">下一页</a>
        </c:if>
        <span>共${pager.allPage}页</span>
    </td>
</tr>
</table>
<%--<c:if test="${pager.pageIndex != 1}">--%>
    <%--<a href="/users/${pager.pageIndex - 1}">上一页</a>--%>
<%--</c:if>--%>
<%--<c:forEach begin="1" end="${pager.allPage}" varStatus="status">--%>
    <%--<c:if test="${pager.pageIndex != status.index}">--%>
        <%--<a href="/users/${status.index}">${status.index}</a>--%>
    <%--</c:if>--%>
    <%--<c:if test="${pager.pageIndex == status.index}">--%>
        <%--<span>${status.index}</span>--%>
    <%--</c:if>--%>

<%--</c:forEach>--%>
<%--<c:if test="${pager.pageIndex != pager.allPage}">--%>
    <%--<a href="/users/${pager.pageIndex + 1}">下一页</a>--%>
<%--</c:if>--%>
<%--<span>共${pager.allPage}页</span>--%>
</body>
</html>
